Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat (dns) : Add host.crc.testing to /etc/hosts (#4410) #4471

Merged
merged 1 commit into from
Nov 25, 2024

Conversation

rohanKanojia
Copy link
Contributor

@rohanKanojia rohanKanojia commented Nov 20, 2024

Fixes: #4410
Relates to: Issue #4410

Solution/Idea

Add another entry in /etc/hosts/ for host.crc.testing domain as suggested in #4410 (comment)

Proposed changes

  • Add another method GetFQDN(string) to CrcBundleInfo struct in order to provide host domain
  • Use abovementioned method in dns.addOpenShiftHosts in order to add another dns entry for host.crc.testing

Testing

After doing crc start you'd notice an additional entry in /etc/hosts for host.crc.testing

Old state of /etc/hosts

# Added by CRC
192.168.130.11   api.crc.testing canary-openshift-ingress-canary.apps.crc.testing console-openshift-console.apps.crc.testing default-ro
ute-openshift-image-registry.apps.crc.testing downloads-openshift-console.apps.crc.testing oauth-openshift.apps.crc.testing
# End of CRC section

New state of /etc/hosts (after these changes):

# Added by CRC
192.168.130.11   api.crc.testing canary-openshift-ingress-canary.apps.crc.testing console-openshift-console.apps.crc.testing default-route-openshift-image-registry.apps.crc.testing downloads-openshift-console.apps.crc.testing host.crc.testing oauth-openshift.apps.crc.testing
# End of CRC section

Copy link

openshift-ci bot commented Nov 20, 2024

Hi @rohanKanojia. Thanks for your PR.

I'm waiting for a crc-org member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@rohanKanojia rohanKanojia changed the title feat (dns) : Add host.crc.testing to /etc/hosts (#4410) feat (dns) : Add host.crc.testing to /etc/hosts (#4410) Nov 20, 2024
@rohanKanojia rohanKanojia marked this pull request as ready for review November 21, 2024 05:02
Copy link
Contributor

@cfergeau cfergeau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from this naming issue, looks good to me!

@@ -112,6 +112,10 @@ func (bundle *CrcBundleInfo) GetAPIHostname() string {
return fmt.Sprintf("api.%s.%s", bundle.ClusterInfo.ClusterName, bundle.ClusterInfo.BaseDomain)
}

func (bundle *CrcBundleInfo) GetHostname() string {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The correct (ie consistent with GetAPIHostname and GetAppHostname) name for this is GetHostHostname, which is awkward
Maybe add a more generic GetFQDN(shortName string) (or GetHostname - which is consistent with GetAppHostname) which could be used for example as return GetFQDN("api") ?

+ Add another method `GetFQDN()` to CrcBundleInfo struct in order to
  provide host domain
+ Use abovementioned method in `dns.addOpenShiftHosts` in order to add
  another dns entry for `host.crc.testing`

Signed-off-by: Rohan Kumar <[email protected]>
Copy link

openshift-ci bot commented Nov 25, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cfergeau

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@praveenkumar praveenkumar merged commit 504c055 into crc-org:main Nov 25, 2024
24 of 35 checks passed
@rohanKanojia rohanKanojia deleted the pr/issue4410 branch November 25, 2024 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add host.crc.testing to /etc/hosts
3 participants